//
//  XinTimePickerVC.swift
//  XinGuoSearch
//
//  Created by 李东 on 2024/4/9.
//

import UIKit

class XinTimePickerVC: UIViewController {

    @IBOutlet weak var datePicker: UIDatePicker!
    var selectCallBack:((String) -> Void)?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        view.backgroundColor = .black.withAlphaComponent(0.5)
    
    }
    
    lazy var df: DateFormatter = {
        let temp = DateFormatter()
        temp.dateFormat = "HH:mm"
        return temp
    }()

    @IBAction func cancelHandle(_ sender: Any) {
        dismiss(animated: true)
    }
    
    @IBAction func okHandle(_ sender: Any) {
        selectCallBack?(df.string(from: datePicker.date))
        dismiss(animated: true)
    }
    

}
